package cn.cheln.explorer.util;

import android.app.Activity;

import cn.cheln.explorer.config.Constants;
import cn.cheln.support.data.text.xml.SPUtil;

public class Commit {
	public static void ifShowCommitInvite(Activity context,String key,int refsum) {
		// count = count==null?-1:count;
		Integer count = ((Integer) SPUtil.getValue(context,
                Constants.SharedPrefernce.File,
                key, Integer.class));
		if (count <= refsum) {
			SPUtil.putValue(context,
                    Constants.SharedPrefernce.File,
                    key, count + 1);
		}
		

	}

	public static void showDialog(Activity context,String key,int commitDid,int refsum) {
		// TODO Auto-generated method stub
		Integer count;
		if ((count = ((Integer) SPUtil.getValue(context,
                Constants.SharedPrefernce.File,
                key, Integer.class))) == refsum) {
			context.showDialog(commitDid);
		}
	}
}
